package com.zhitan.ems.app.iot.enums;

/**
 * 能源类型枚举
 * @author zhitan
 */
public enum ENERGY_TYPES_ENUM {
	Water("水", 10,"water_data","吨"), 
	Electricity("电", 20,"electricity_data","千瓦时"), 
	Gas("气", 30,"gas_data","立方米"), 
	Heat("热", 40,"heat_data","立方米"), 
	Photovoltaic("光伏", 50,"pv_data","千瓦时"),;
	private final String name;
	private final Integer code;
	private final String table;
	private final String dw;
	ENERGY_TYPES_ENUM(String name, Integer code,String table,String dw) {
		this.name = name;
		this.code = code;
		this.table = table;
		this.dw = dw;
	}
	public String getName() {
		return name;
	}

	public Integer getCode() {
		return code;
	}
	public String getTable() {
		return table;
	}
	public String getDw() {
		return dw;
	}
	public static ENERGY_TYPES_ENUM findByCode(int _nCode) {
		for (ENERGY_TYPES_ENUM type : ENERGY_TYPES_ENUM.values()) {
			if (_nCode == type.code) {
				return type;
			}
		}
		return Electricity;
	}
	
}
